<style>
.layui-form-label {width: 120px!important;}
.layui-input-block {margin-left: 120px!important;}
</style>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">

	<!-- END RIBBON -->
	<div class="content">
		<div class="panel panel-default panel-intro">
			<div class="panel-heading">
				<div class="panel-lead">
					<em>
						敏感词管理
					</em>
					....
				</div>
			</div>
			<div class="panel-body">
				<div id="myTabContent" class="tab-content">
					<div id="main" role="main">
						<div class="tab-content tab-addtabs">
							<div>
								<div class="row">
									<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
											<div class="content">
											<form class="layui-form" >
												<div class="layui-form-item">
													<label class="layui-form-label">敏感词数：</label>
													<div class="layui-input-block" style="line-height: 36px;">{$num}</div>
												</div>
												
												<div class="layui-form-item layui-form-text">
													<label class="layui-form-label">使用 | 分割：</label>
													<div class="layui-input-block">
														<textarea name="desc" placeholder="可为空" class="layui-textarea" id="content" rows="4">{$content}</textarea>
													</div>
												</div>
				
				
												{if condition="$adminController->vif('security','sensitive_upd')"}
												<div class="layui-form-item">
													<label class="layui-form-label"></label>
													<div class="layui-input-block">
															<button type="button" id="prevstep" class="btn btn-sm btn-primary" style="display: inline-block;">确认提交</button>
													</div>
												</div>
												{/if}
											</form>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>







<script>
layui.use(['form'], function(){
var form = layui.form;
});

//监听提交
$("#prevstep").on('click', function(){
	var content = $('#content').val();
	var data    = {content:content};
	var n = (content.split('|')).length;
	if (n > 5000) {
		$.thinkmimi({Content : '敏感词最大支持个数为5000个，当前个数为：'+n+' 个！', Type:2, Align:'right', OutTime:3000}); return false;
	}

	$.ajax({
		type: 'post',
		data: data,
		url: "{:url('security/sensitive_upd')}",
		success: function(data) {
			var array = eval('(' + data+ ')');
			if (array['code'] == '01') {
				$.thinkmimi({Content : array['msg'], Type:2, Align:'right', OutTime:2000});
			} else {
				$.thinkmimi({Content : array['msg'], Type:1, Align:'right', OutTime:2000});
				setTimeout(function(){window.location.href = "{:url('security/sensitive')}";},1500); 
			}
		}
	});
});

</script>